Skip to content

Restore cwd reliably in build-xml module scanning - #1647

Open
ashishkrshaw wants to merge 1 commit into
OSGeo:grass8from
ashishkrshaw:fix/build-xml-restore-cwd
Open

Restore cwd reliably in build-xml module scanning#1647
ashishkrshaw wants to merge 1 commit into
OSGeo:grass8from
ashishkrshaw:fix/build-xml-restore-cwd

Conversation

@ashishkrshaw

Copy link
Copy Markdown

I noticed a small failure mode in utils/cronjobs_osgeo_lxd/build-xml.py: _get_module_files() changes into a module directory and restores cwd only on the success path. If _scandirs() raises, the process cwd stays changed and later steps can fail in confusing ways.\n\nThis patch wraps the chdir block in try/finally so cwd is always restored, including on exceptions. Behavior is unchanged on success, but error handling is now safer and deterministic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant